Building Code with Dynamic Staging

نویسندگان

  • Piotr Danilewski
  • Philipp Slusallek
چکیده

When creating a new domain-specific language (DSL) it is common to embed it as a part of a flexible host language, rather than creating it entirely from scratch. The semantics of an embedded DSL (EDSL) is either given directly as a set of functions (shallow embedding), or an AST is constructed that is later processed (deep embedding). Typically, the deep embedding is used when the EDSL specifies domain-specific optimizations (DSO) in a form of AST transformations. In this paper we show that deep embedding is not necessary to specify most optimizations. We define language semantics as action functions that are executed during parsing. These actions build incrementally a new, arbitrary complex program function. The EDSL designer is able to specify many aspects of the semantics as a runnable code, such as variable scoping rules, custom type checking, arbitrary control flow structures, or DSO. A sufficiently powerful staging mechanism helps assembling the code from different actions, as well as evaluate the semantics in arbitrarily many stages. In the end, we obtain code that is as efficient as one written by hand. We never create any object representation of the code. No external traversing algorithm is used to process the code. All program fragments are functions with their entire semantics embedded within the function bodies. This approach allows reusing the code between EDSL and the host language, as well as combining actions of many different EDSLs.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Direct Displacement Based Design of Reinforced Concrete Elevated Water Tanks Frame Staging

Elevated water tanks supported by the reinforced concrete (RC) Staging are classified as inverted pendulum structures. These are considered as structures of high post-earthquake importance and should remain functional after the seismic events. National codes of various countries recommend Force-Based Design (FBD) procedure for water tank staging, which does not ensure nonlinear performance leve...

متن کامل

Seismic Performance of Torsionally Stiff and Flexible Single Story Buildings Designed Based on Iranian Seismic Code(Standard 2800)

This paper examines differences in performances of a range of torsionally stiff and flexible single story buildings designed with the provisions of Iranian Standard 2800. Seismic nonlinear dynamic time history behavior of eight building models subjected to seven horizontal bi-directional design spectra compatible ground motions are investigated. These models cover a wide range of very torsional...

متن کامل

Assessment of an RC existing hospital building with special moment frame using fragility curve

In this study, an existing hospital structure has been evaluated with incremental dynamic analysis (IDA). This building is accommodated in Karaj with soil type II. At first, two 2-D frames along X, Y direction are selected. Then, five performance levels are determined according to “Rehabilitation Code for Existing Buildings (Publication No. 360) including Immediate Operational (IO), Limited Dam...

متن کامل

Evaluation of Torsional Single Story Structure During Earthquake According to Canadian provision

In this article, we tried to emphasis in how the range of torsionally stiff and flexible single story buildings works. The designed base was according to provisions of the Canadian standard, 2005 NBCC. The behavior of nonlinear dynamic time history of eight building models subjected to seven horizontal bi-directional ground motions compatible with design spectra are investigated. These models c...

متن کامل

Seismic Performance of RC Frames Irregular in Elevation Designed Based on Iranian Seismic Code

Setback in elevation of a structure is a special irregularity with considerable effect on its seismic performance. This paper addresses multistory Reinforced Concrete (RC) frame buildings, regular and irregular in elevation. Several multistory Reinforced Concrete Moment Resisting Frames (RCMRFs) with different types of setbacks, as well as the regular frames in elevation, are designed according...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:
  • CoRR

دوره abs/1612.01325  شماره 

صفحات  -

تاریخ انتشار 2016